package Model.SurroundModel;

public class Parameter {
    public static double k = 2;
    public static double k0 = 1;
    public static double k1 = 2;
    public static double k2 = 2;
    public static double alpha = 10;
    public static double N = 4; //目标与智能体的个数
    //拉普拉斯矩阵A 这里采用论文里面的第一种情况的连通图
    public static double A[][]={{2,-1,-1,0},{-1,1,0,0},{-1,0,2,-1},{0,0,-1,1}};
    public Parameter(int n){
        this.n = n;
    }
    public int n;
    public double[][] setA(){
        double a[][] = new double[n][n];
        for (int i = 0 ;i<n;i++){
            if (i==0){
                for (int j = 0;j<n;j++){
                    if (j==0) a[i][j]=1;
                    else if (j==1) a[i][j]=-1;
                    else a[i][j]=0;
                }
            }else if (i==n-1){
                for (int j = 0;j<n;j++){
                    if (j==n-1) a[i][j]=1;
                    else if (j==n-2) a[i][j]=-1;
                    else a[i][j]=0;
                }
            }else {
                for (int j =0 ;j<n;j++){
                    if (j==i) a[i][j]=2;
                    else if (j==i-1||j==i+1) a[i][j]=-1;
                    else a[i][j]=0;
                }
            }
        }
        return a;
    }
}
